<?
include('header.php');
if(isset($_POST['send'])) {
	if($_POST['name'] == ""){
		$mesaj = '<div class="msg"><div class="error">ERROR: Please enter your real name!</div></div>';
	}else if($_POST['email'] == ""){
		$mesaj = '<div class="msg"><div class="error">ERROR: Please enter your email address!</div></div>';
	}else if($_POST['message'] == ""){
		$mesaj = '<div class="msg"><div class="error">ERROR: Please enter your message!</div></div>';
	}else{
		$subject ="Contact";
		$message="{$_POST['message']}";
		$header="From: {$_POST['name']} <{$_POST['email']}>";
		mail($site['site_email'],$subject,$message,$header);
		$mesaj = '<div class="msg"><div class="success">Message Sent!</div></div>';
	}
}?>
<div class="block medium right">
			<div class="top"><h1>Contact</h1></div>
			<div class="content">
<?=$mesaj?>
			<form method="post">
				<fieldset>
					<p>
							 <label>Your Name</label> <br/>
							 <input class="text big" type="text" value="" name="name" required="required" />
					</p>
                    <p>
							 <label>Email</label> <br/>
							 <input class="text big" type="email" value="<? echo $data->email;?>" name="email" required="required" />
					</p>
                    <p>
							 <label>Textarea</label> <br/>
							 <textarea name="message" rows="6" cols="80" required="required"></textarea>
					</p>
                    <p>
						  	<input type="submit" class="button gray small" value="Send" name="send" />
					</p>

				</fieldset>
			</form>
		</div>
	</div>
<?include('footer.php');?>